<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
  <%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<c:set var="loggedIn" value="${param.loggedIn}"></c:set>

<c:choose>
   <c:when test="${loggedIn == 'true'}">
<div class="panel">
    </div>
    <div class="panel dum">
    <div class="panel-menu">
        <a href="home" class="logo">agcrm</a>
        <a href="home"><img src="/sales/images/icon-home.png" /></a>
        <a href="people" class="active top-btn">People</a>
    </div>
        <div class="top-right-btn" style="padding: 9px 10px;"><img src="/sales/images/settings.png">
        <ul class="drop-menu" style="margin-left: -115px;">
            <li><a href="profile">Personal Information</a></li>
            <li><a href="changePassword">Change Password</a></li>
<!--             <li><a href="#">Themes</a></li> -->
<!--             <li><a href="#">Help</a></li> -->
        </ul>
        </div>
        <div class="top-right-btn" style="padding: 11px 10px;"><img src="/sales/images/plus.png">
        <ul class="drop-menu" style="margin-right: -27px; right: 75px;">
        <shiro:hasRole name="leadAdd">
            <li><a href="newLead">New Lead</a></li>
        </shiro:hasRole>
		<shiro:hasRole name="accountAdd">
            <li><a href="new-account">New Account</a></li>		
        </shiro:hasRole>    
		<shiro:hasRole name="contactAdd">
            <li><a href="new-contact">New Contact</a></li>
        </shiro:hasRole>         
            <%-- <li><a href="#">New Opportunity</a></li> --%>
        </ul>
        </div>
        <div class="top-right-btn"><li style="font-weight: bold; margin: 0 15px 0 0;list-style-image: url('/sales/images/s_arrow.png'); direction: rtl; ">${userDetails.fName}
        <ul class="drop-menu" style="right: 100px;">
            <li><a href="/sales/s/profile">${userDetails.email}</a></li>
            <li><a href="/sales/s/profile">View Profile</a></li>
            <li><a href="/sales/s/login">Sign Out</a></li>
        </ul>
        </li>
        </div>
        <div class="top-right-btn" style="padding: 4px 10px;border: 0;">
        <c:choose>
          <c:when test="${userDetails.photo==null}">
             <a href="/sales/s/profile"><img src="../images/noprofile.jpg" style="height: 30px; width: 30px;"/></a>
          </c:when>
          <c:otherwise>
             <a href="/sales/s/profile"><img src="${userDetails.photo.encode}" style="height: 30px; width: 30px;"/></a>
          </c:otherwise>
        </c:choose>       
        </div>
         
        <div class="top-right-btn notificationIcon">
        	<div onclick="window.location='pendingRequests'" class="countNotifications toolTip">${joinRequestCount}
	        	<div class="toolTipContent">Requests</div>
        	</div>
        </div>
        
        <div class="top-right-btn notificationIcon">
        	<div onclick="window.location='calendar?empId=${userDetails.id}'" class="countNotifications toolTip" style="background-color: rgb(226, 109, 0);">${appointmentEvents}
	        	<div class="toolTipContent">Appointments</div>
        	</div>
        </div>
         
        <div class="top-right-btn notificationIcon">
        	<div onclick="window.location='calendar?empId=${userDetails.id}'" class="countNotifications toolTip" style="background-color: rgb(134, 168, 0);">${callEvents}
	        	<div class="toolTipContent">Calls</div>
        	</div>
        </div>

    </div>
    <span class="flip"><img src="/sales/images/arrow-up.png"/></span>
   </c:when>
   <c:otherwise>
    <div class="panel">
    </div>
    <div class="panel dum">
    <div class="panel-menu">
        <a href="index.jsp" class="logo">agcrm</a>
        <a href="index.jsp"><img src="/sales/images/icon-home.png" /></a>
    </div>
    <div class="log">
        <a href="/sales/s/login">Sign In</a>
       <%-- <a href="/sales/s/register">Sign Up</a>--%> 
    </div>
    </div>
    <span class="flip"><img src="/sales/images/arrow-up.png"/></span>
   </c:otherwise>
</c:choose>